package org.sqrd.webserver.util;

import org.sqrd.webserver.framework.LiveObject;

public class ClassUtil {

	public static Object getObject(String classpath){
		Class mc;
		Object obj = new Object();
		LiveObject lo;
		try {
			mc = ClassLoader.getSystemClassLoader().loadClass(classpath);
			try {
				obj = mc.newInstance();
			} catch (InstantiationException e) {
				e.printStackTrace();
			} catch (IllegalAccessException e) {
				e.printStackTrace();
			}
			if(obj instanceof LiveObject) {
				lo = (LiveObject)obj;
				System.out.println(lo.getText());
			}
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
		return obj;
	}

}
